home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Developer's Companion
/
Java Developer's Companion.iso
/
Javacup
/
IN231VFD.TAR
/
internet
/
IN231VFD
/
LabList.java
< prev
next >
Wrap
Text File
|
1996-05-21
|
809b
|
37 lines
// LabList.java - A labelled listbox
//
// Copyright (C) 1996 by Dale Gass
// Non-exclusive license granted to MKS, Inc.
//
import java.lang.*;
import java.util.*;
import java.awt.*;
import java.net.*;
import java.applet.*;
// LabList = a labelled listbox
public class LabList extends Panel {
public Label label;
public List list;
LabList(String title, int rows, boolean multi) {
setLayout(new BorderLayout());
add("North", label = new Label(title, Label.LEFT));
add("Center", list = new List(rows, multi));
}
public void addItems(String items[]) {
for (int i=0; i<items.length; i++)
list.addItem(items[i]);
}
public void selectAll() {
int n = list.countItems();
for (int i=0; i<n; i++)
list.select(i);
}
}